package com.clicacao.clicacao;

import android.app.Activity;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.ImageView;
import android.widget.Toast;

public class PhotoScreen extends Activity{
	
	ImageView imageView;
	Button btnClosePhotoView;
	String mediaPath;

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.photo_screen);

		
		//Aqui o caboclo traz o nome da foto ... eu vejo se jah existe no diretorio da aplicacao, se nao existir eu 
		//faco o download
		
		mediaPath = getIntent().getExtras().getString("mediaPath");
		imageView = (ImageView)findViewById(R.id.imgPhotos);
				
		Bitmap bitmap;
		bitmap = BitmapFactory.decodeFile(mediaPath, null);
		imageView.setImageBitmap(bitmap);
		
		btnClosePhotoView = (Button)findViewById(R.id.btnClosePhotoView);
		//Programando botao de fechamento da visao da foto
		btnClosePhotoView.setOnClickListener(new View.OnClickListener() {
			
			public void onClick(View v) {
				//Apenas finaliza a intent
				finish();
			}
		});
		
		
	}
	
}
